package com.yootk.main;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.util.ClassUtils;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

public class ClasspathResourceDemo {
    public static void main(String[] args) throws Exception { // 该抛就抛
        Resource resource = new ClassPathResource("123.txt") ;
        System.out.println(resource.getFile());
        System.out.println("1,ClassLoader" + ClassUtils.getDefaultClassLoader());
        System.out.println("2,ClassLoader" + ClasspathResourceDemo.class.getClassLoader());
    }
}